package com.db.person.service;

import com.db.person.bean.Employee;
import com.db.person.mapper.EmployeeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements IEmployeeService{

    @Autowired
    private EmployeeMapper employeeMapper;

    @Override
    public List<Employee> getEmployeesAndUserIdIsNull() {
        return employeeMapper.getEmployeesAndUserIdIsNull();
    }

    @Override
    public void updateUserId(Integer user_id, Integer emp_id) {
        employeeMapper.updateUserId(user_id,emp_id);
    }

    @Override
    public List<Employee> getAll() {
        return employeeMapper.getAll();
    }

    @Override
    public void insert(Employee employee) {
        employeeMapper.insert(employee);
    }

    @Override
    public Employee getById(Integer id) {
        return employeeMapper.getById(id);
    }

    @Override
    public void update(Employee employee) {
        employeeMapper.update(employee);
    }
}
